/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package neo.workforce.dao.impl;

import java.util.List;
import neo.workforce.dao.CommonDAO;
import neo.workforce.dao.ListDAO;
import org.apache.log4j.Logger;

/**
 *
 * @author krisada
 */
public class ListDAOImpl extends CommonDAO implements ListDAO {

    private static final long serialVersionUID = 3182917933742318136L;
    private Logger log = Logger.getLogger(this.getClass());

    public neo.workforce.dao.List find(long id) {
        return (neo.workforce.dao.List) super.find(neo.workforce.dao.List.class, id);
    }

    public Long save(neo.workforce.dao.List list) {
        return super.save(list);
    }

    public boolean update(neo.workforce.dao.List list) {
        return super.update(list);
    }

    public boolean remove(long id) {
        return super.remove(List.class, id);
    }

    public java.util.List findAll(long fieldId) {
        StringBuilder buf = new StringBuilder();
        buf.append("FROM neo.workforce.dao.List o WHERE o.field.id = ").append(fieldId).append(" desc o.createDate");
        log.info(buf.toString());
        java.util.List ls = getHibernateTemplate().find(buf.toString());
        return ls;
    }

    public java.util.List findByName(String listName, long fieldId) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    public java.util.List findByName(int begin, int limit, String liatName, long fieldId) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
